package main

import (
	"github.com/urfave/cli/v2"
	"github.com/ycjiafei/tsf-deploy/internal/app/deploy"
	"k8s.io/client-go/util/homedir"
	"log"
	"os"
	"path/filepath"
)

func main() {
	app := &cli.App{
		Name: "TSF-Deploy",
		Usage: "tsf 应用程序部署",
		Flags: args(),
		Action: deploy.Deploy,
	}

	if err := app.Run(os.Args); err != nil {
		log.Fatalln(err)
	}
}


func args() []cli.Flag {
	return []cli.Flag{
		&cli.StringFlag{
			Name: "kubeconfig",
			Value: filepath.Join(homedir.HomeDir(), ".kube", "config"),
			Usage: "k8s config 文件位置",
		},
		&cli.StringFlag{
			Name: "group",
			Value: "",
			Usage: "TSF部署组名称",
		},
		&cli.StringFlag{
			Name: "ns",
			Value: "",
			Usage: "部署组所在的命名空间",
		},
		&cli.StringFlag{
			Name: "image",
			Value: "",
			Usage: "需要部署的完整镜像名",
		},
	}
}